//封装成单独的路由方便编辑修改使用,其中路由信息靠export导出供使用
import {createWebHashHistory,createRouter} from 'vue-router'
import Doc from './views/Doc.vue'
import Home from './views/Home.vue'
import switchDemo from './components/switchDemo.vue'
import buttonDemo from './components/buttonDemo.vue'
import dialogDemo from './components/dialogDemo.vue'
import tabsDemo from './components/tabsDemo.vue'
import intro from './views/intro.vue'
import install from './views/install.vue'

const history=createWebHashHistory();
export const router=createRouter({
    history:history,
    routes:[
        {path:'/', component:Home},
        {path:'/Doc', component:Doc,
        children:[
            //将文档页重定向在介绍页面,path需为""空路径
        {path:"", redirect: '/Doc/Intro'},
        {path:'Intro', component:intro},
        {path:'Install', component:install},
        {path:'Switch',component:switchDemo},
        {path:'Button',component:buttonDemo},
        {path:'Dialog',component:dialogDemo},
        {path:'Tabs',component:tabsDemo}
    ],
    }
    ]
});